﻿using AutoMapper;
using Core.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Core.AutoMapper
{
    public class CustomProfile:Profile
    {

        
        public CustomProfile()
        {
            CreateMap<BlogArticle, BlogViewModels>();

            CreateMap<BlogViewModels, BlogArticle>().ForMember("bsubmitter", opt => opt.MapFrom(src => src.bRemark));


            //var config = new MapperConfiguration(cfg =>
            //{
            //    cfg.CreateMap<BlogArticle, BlogViewModels>();
            //    cfg.CreateMap<BlogViewModels, BlogArticle>();
            //        //.ForMember("EmployeeID", opt => opt.MapFrom(src => src.ID))
            //        //.ForMember(dest => dest.EmployeeName, opt => opt.MapFrom(src => src.Name))
            //        //.ForMember(dest => dest.JoinYear, opt => opt.MapFrom(src => src.JoinTime.Year));
            //});
        }

        

    }
}
